#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushbutton_up_clicked()
{
    QRect rect = ui->pushbutton_target->geometry();
    qDebug() << rect;
    ui->pushbutton_target->setGeometry(rect.x(), rect.y()-5, rect.width(), rect.height());

//    rect.setY(rect.y()-5);
//    ui->pushbutton_target->setGeometry(rect);
}


void Widget::on_pushbutton_down_clicked()
{
    QRect rect = ui->pushbutton_target->geometry();
    ui->pushbutton_target->setGeometry(rect.x(), rect.y()+5, rect.width(), rect.height());
//    rect.setY(rect.y()+5);
//    rect.setHeight(rect.height()+5);
//    ui->pushbutton_target->setGeometry(rect);
}

void Widget::on_pushbutton_left_clicked()
{
    QRect rect = ui->pushbutton_target->geometry();
    ui->pushbutton_target->setGeometry(rect.x()-5, rect.y(), rect.width(), rect.height());
//    rect.setX(rect.x()-5);
//    ui->pushbutton_target->setGeometry(rect);
}

void Widget::on_pushbutton_right_clicked()
{
    QRect rect = ui->pushbutton_target->geometry();
    ui->pushbutton_target->setGeometry(rect.x()+5, rect.y(), rect.width(), rect.height());
//    rect.setX(rect.x()+5);
//    ui->pushbutton_target->setGeometry(rect);
}
